package org.eztouch.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/user")
public class UserController {
	
	@Autowired
	private RestTemplate restTemplate;
	
	
	@RequestMapping(value = "/getUserById" ,method = RequestMethod.GET)
	public Object getUserById(@RequestParam String userId){
		System.out.println("接收到的参数：userId="+userId);
		String result = restTemplate.getForEntity("http://EZTOUCH-SYS-SERVICE:18080/userService/getUserById?userId="+userId, String.class).getBody();
		
		return result;
	}
}
